/*
 * Copyright 2010 Matt Oliveri
 *
 * This file is part of JConfigGen
 *
 * JConfigGen is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * JConfigGen is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with JConfigGen.  If not, see <http://www.gnu.org/licenses/>.
 */

package atma.jconfiggen.sax;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;

class ElemH extends HandlerHelper
{
	ElemH(SAXHandler s) {super(s);}

	private ElemH misplace(String tag) throws SAXException {return complain("Element cannot go here: " + tag);}

	ElemH elem(SAXHandler.Elem e,Attributes attr) throws SAXException {return misplace(e.name().toLowerCase());}
	ElemH elemstr(String tag,Attributes attr) throws SAXException {return misplace(tag);}
	void chars(char[] ch,int s,int l) throws SAXException {if (!new String(ch,s,l).trim().equals("")) complain("Character data cannot go here");}
	void end() throws SAXException {}
}
